﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QLQTPM_Nhom6.BUS;
using QLQTPM_Nhom6.DTO;
using System.Collections;

namespace QLQTPM_Nhom6
{
    public partial class frmQLDuLieu : Form
    {
        public frmQLDuLieu()
        {
            InitializeComponent();
        }

        private void hướngDẫnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Show hướng dẫn");
        }

        private void khởiĐộngLạiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Restart();
        }

        private void liênHệToolStripMenuItem_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("mailto:Group6KHTN@gmail.com");
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Shhow form about");
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            notifyIcon1.Dispose();
            this.Close();
        }

        private void frmQLDuLieu_Load(object sender, EventArgs e)
        {
            notifyIcon1.ShowBalloonTip(1000);
            ArrayList arrDuLieu = new ArrayList();
            arrDuLieu = DuLieuBUS.LayToanBoDuLieu();
            for (int i = 0; i < arrDuLieu.Count; i++)
            {
                DuLieuDTO dl = new DuLieuDTO();
                dl = (DuLieuDTO)arrDuLieu[i];
                Object[] t = { dl.MaDuLieu, dl.TenDiaDiem, dl.TenDichVu, dl.SoNha, dl.TenDuong, dl.TenPhuong, dl.KinhDo, dl.ViDo, dl.ChuThich };
                dgv_DanhSachDuLieu.Rows.Add(t);
            }           
        }

        private void tsmi_DiaDiem_Click(object sender, EventArgs e)
        {
            Form frmDiaDiem = new frmQLDiaDiem();            
            frmDiaDiem.ShowDialog();
        }

        private void TSMI_DichVu_Click(object sender, EventArgs e)
        {
            Form frmDichVu = new frmQLDichVu();
            frmDichVu.ShowDialog();
        }

        private void TSMI_Duong_Click(object sender, EventArgs e)
        {
            Form frmDuong= new frmQLDuong();
            frmDuong.ShowDialog();
        }

        private void TSMI_Phuong_Click(object sender, EventArgs e)
        {
            Form frmPhuong = new frmQLPhuong();
            frmPhuong.ShowDialog();
        }

        private void TSMI_QuanHuyen_Click(object sender, EventArgs e)
        {
            Form frmQuanHuyen = new frmQLQuanHuyen();
            frmQuanHuyen.ShowDialog();
        }

        private void TSMI_TinhThanh_Click(object sender, EventArgs e)
        {
            Form frmTinhThanh = new frmQLTinhThanh();
            frmTinhThanh.ShowDialog();
        }

        private void TSMI_Thoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
